#include <stdio.h>
#include <string.h>
#include <pthread.h>

static pthread_t pid; 

static void *thread_fun(void *ptr)
{
	while(1)
	{
		sleep(2);
		printf("child-thread\r\n");	
	}

	return NULL;
}

int main()
{
	int ret = 0;
	
	ret = pthread_create(&pid, NULL, thread_fun, NULL);
	if(ret!=0)
	{
		printf("pthread_create error\r\n");
		return -1;
	}

	while(1)
	{
		sleep(1);
		printf("main-thread\r\n");
	}

	return 0;
}

